# Contributor: Galen Abell <galen@galenabell.com>
# Maintainer: Galen Abell <galen@galenabell.com>
pkgname=py3-sphinx-autodoc-typehints
_pyname=sphinx-autodoc-typehints
pkgver=1.25.2
pkgrel=0
pkgdesc="Type hints support for the Sphinx autodoc extension"
url="https://github.com/tox-dev/sphinx-autodoc-typehints"
arch="noarch"
license="MIT"
options="net"
depends="python3 py3-sphinx py3-typing-extensions"
makedepends="py3-gpep517 py3-installer py3-hatchling py3-hatch-vcs"
checkdepends="py3-pytest py3-sphobjinv py3-nptyping"
subpackages="$pkgname-pyc"
source="$_pyname-$pkgver.tar.gz::https://github.com/tox-dev/sphinx-autodoc-typehints/archive/refs/tags/$pkgver.tar.gz"
builddir="$srcdir/$_pyname-$pkgver"

build() {
	export SETUPTOOLS_SCM_PRETEND_VERSION=$pkgver
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages test-env
	test-env/bin/python3 -m installer .dist/sphinx_autodoc_typehints*.whl
	test-env/bin/python3 -m pytest
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/sphinx_autodoc_typehints*.whl
}

sha512sums="
18239ca13114d14207309c9d7c1f9eed9afc5c8842044a91722580b88827c420fec96ff87d57d7fb31661d4fb04c6d043fd82e73e316e2ba825d7f15d4ea6cd3  sphinx-autodoc-typehints-1.25.2.tar.gz
"
